import React, { memo } from "react";
import { UserEventWrap } from "./style";
import EventComment from "@/components/user/eventComment";

export default memo(function UserEvent(props) {
  return (
    <UserEventWrap>
      <div>
        {props.userEventInfo.code == 200
          ? props.userEventInfo.events.map((item, index) => {
              return item.type == 57 ? (
                <React.Fragment key={item.eventTime}></React.Fragment>
              ) : (
                <React.Fragment key={item.eventTime}>
                  <EventComment
                    num={index}
                    userDetailInfo={props.userDetailInfo}
                    item={item}
                  />
                </React.Fragment>
              );
            })
          : ""}
      </div>
    </UserEventWrap>
  );
});
